<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>若梦TV，全网品质好单采集平台</title>
	<meta name="keywords" content="若梦、若梦TV、若梦金冠联盟、采集站、淘客、淘宝客、淘客工具、淘客软件、淘客联盟
">
	<meta name="description" content="若梦TV采集站ruomengtv.com，是若梦金冠联盟优质好单采集平台；专注优质商品，严格把控品质，超高转化，提高收益，为淘客提供最好的商品精选采集平台！">
	<link rel="icon" href="favicon.ico">
	<link rel="stylesheet" type="text/css" href="../../lib/css/animate.min.css">
	<link rel="stylesheet" type="text/css" href="../../layui/css/layer.min.css">
	<link rel="stylesheet" type="text/css" href="../../lib/css/jquery.page.min.css">
	<link rel="stylesheet" type="text/css" href="../../lib/css/fakeloader.css">
	<link rel="stylesheet" type="text/css" href="../../lib/css/reset.css">
	<link rel="stylesheet" type="text/css" href="../../css/comm.css">
	<link rel="stylesheet" type="text/css" href="../../css/data_main.css">
	<link rel="stylesheet" type="text/css" href="../../css/style.css">
	<link rel="stylesheet" type="text/css" href="../../iconfont/iconfont.css">

</head>
<body>
	<!-- 头部 -->
	<header class="header">
		<div class="head">
			<div class="head-left left">
				<a href="index.html" title="若梦TV--首页"><img src="../../img/logo.png" alt=""></a>
				<div class="experience">
					<div class="left">体验</div>
					<div class="right"><a href="http://tool.ruomengtv.com" title="天天赚发单助手" target="_blank">天天赚发单助手</a></div>
				</div>
			</div>
			<!--搜索-->
			<div class="left search-wrap active">
				<div class="left">
					<input type="text" placeholder="输入关键词或商品链接">
					<!--搜索历史-->
					<div class="searchHistory">
						<!-- <div class="historyItem">1</div>
						<div class="historyItem">2</div>
						<div class="historyItem">什么事没事没事</div>
						<div class="historyItem">耐克</div>
						<div class="historyItem">鞋子啊</div> -->
					</div>
					<!--搜索历史结束-->
				</div>
				<div class="right">搜索</div>
			</div>
			<!--搜索结束-->
			<div class="head-right right">
				<div class="left login btn" onclick="location.href='../login/login.html';">登录</div>
				<div class="right register btn" onclick="location.href='../login/regsiter.html';">注册</div>
			</div>
			<!--登录后显示区域-->
			<div class="head-right2 right hide">
				<img class="left releaseIcon" src="../../img/head_icon1.png" title="发布" alt="">
				<img class="left informIcon" src="../../img/head_icon2.png" title="未读消息" alt="">
				<div class="left informNum" title="未读消息">0</div>
				<div class="left headOuter" title="个人中心">
					<img class="headPic" src="../../img/default_head.png" alt="">
				</div>
			</div>
			<!--登录后显示区域结束-->
		</div>
	</header>

	<!--主体内容-->
	<div class="wrap">
		<!--状态类别栏-->
		<div class="statusSorts" style="margin-top: 100px;">
			<span class="btn btn1 all active" data-sort="">全部<span class="allNum">（0）</span></span>
			<span class="btn btn1 passed" data-sort=1>通过<span class="passedNum">（0）</span></span>
			<span class="btn btn1 repulse" data-sort=2>打回<span class="repulseNum">（0）</span></span>
			<div class="btn emptyBtn"><i class="iconfont">&#xe600; </i> 清空</div>
		</div>
		<!--状态类别栏结束-->
		<!--消息区域-->
		<div class="msgArea">
			<!--<div class="msgItem">
				<div class="content">
					<img src="../../img/message.png" alt="">
					<span class="text">您于2017-03-03 11:23:33提交的 <span class="goodsName">商品名称</span> 审核未通过，扣10积分！</span>
				</div>
				<div class="time">2017-05-06 11:23:33</div>
			</div>-->
			<!--<div class="msgItem">
				<div class="content">
					<img src="../../img/message.png" alt="">
					<span class="text">您于2017-03-03 11:23:33提交的 <span class="goodsName">商品名称</span> 已通过审核，即将发布，恭喜！</span>
				</div>
				<div class="time">2017-05-06 11:23:33</div>
			</div>-->
		</div>
		<!--消息区域结束-->

		<!-- 分页 -->
		<div class="page-wrap hide">
			<div id="page"></div>
		</div>
		<!--分页结束-->
	</div>
	<!--主体内容结束-->

	<!-- 加载层 -->
	<div class="fakeloader"></div>

	<!-- 返回顶部 -->
	<div class="scrollTop">
		<div class="scrollTop-top">
		</div>
		<div class="scrollTop-bottom">
			返回顶部
		</div>
	</div>

	<!--遮罩层-->
	<div class="grey hide" onclick="popHide();"></div>
	<!--遮罩层结束-->

	<!--提交新单弹窗-->
	<div class="popUp submitNewPop hide">
		<div class="titleArea gradient">
			<div class="spaceBox"><!--为防止垂直间距合并--></div>
			<div class="title">提交新单</div>
		</div>
		<div class="contentArea">
			<div class="outer headOuter">
				<label>商品图</label>
				<div class="uploadOuter">
					<img id="goodsIcon" src="../../img/head_upload.png" alt="">
					<input id="uploadGoods" type="file" class="addimgIpt" name="file" accept="image/gif,image/jpeg,image/png"/>
				</div>
				<span class="tips">尺寸大小为400*400像素</span>
			</div>
			<div class="outer headOuter">
				<label>文案图</label>
				<div class="uploadOuter">
					<img id="wenanIcon" src="../../img/head_upload.png" alt="">
					<input id="uploadWenan" type="file" class="addimgIpt" name="file" accept="image/gif,image/jpeg,image/png"/>
				</div>
				<span class="tips">尺寸大小为800*1200像素</span>
			</div>
			<div class="outer">
				<label for="title">商品标题</label>
				<input id="title" type="text" placeholder="请填写商品标题">
			</div>
			<div class="outer">
				<label for="originalPrice">原价</label>
				<input id="originalPrice" type="number" placeholder="请填写原价">
				<span class="unit">元</span>
			</div>
			<div class="outer">
				<label for="presenPrice">券后价</label>
				<input id="presenPrice" type="number" placeholder="请填写券后价">
				<span class="unit">元</span>
			</div>
			<div class="outer">
				<label for="couponUrl">优惠券</label>
				<textarea name="" id="couponUrl" placeholder="请填写优惠券链接"></textarea>
			</div>
			<div class="outer">
				<label for="productUrl">商品链接</label>
				<input id="productUrl" type="text" placeholder="请填写商品链接">
			</div>
			<div class="outer">
				<label for="copywriting">文案</label>
				<textarea name="" id="copywriting" placeholder="请填写文案"></textarea>
			</div>
			<div class="outer">
				<label for="brokerage">佣金</label>
				<input id="brokerage" type="number" placeholder="请填写佣金">
				<span class="unit">%</span>
			</div>
			<div class="outer brokerageType">
				<label>佣金类型</label>
				<div class="sorts">
					<div class="btn sort active" data-sort="1">通用</div>
					<div class="btn sort" data-sort="2">定向</div>
					<div class="btn sort" data-sort="3">鹊桥</div>
					<div class="btn sort" data-sort="4">营销</div>
				</div>
			</div>
			<div class="outer activeSync">
				<label>活动同步</label>
				<div class="sorts syncSort">
					<div class="btn sort active" data-sort="1">是</div>
					<div class="btn sort" data-sort="0">否</div>
				</div>
			</div>
			<div class="outer activeTypeOuter">
				<label>活动类型</label>
				<div class="sorts">
					<div class="btn sort active" data-sort="1">聚划算</div>
					<div class="btn sort" data-sort="2">淘抢购</div>
				</div>
			</div>
		</div>
		<div class="btnArea">
			<div class="btn gradient">确定</div>
		</div>
	</div>
	<!--提交新单弹窗结束-->
</body>

<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.page.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/clipboard.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../layui/lay/dest/layui.all.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../layui/layer.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/fakeloader.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.lazyload.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../js/main.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../lib/js/jquery.hDialog.min.js"></script>
<script type="text/javascript" charset="UTF-8" src="../../js/data_main.js"></script>
<script>
var usercode = getStorage("usercode");

$( function()
{
	//默认加载所有消息
	getMessages("",1);

	//切换消息类别
	$( ".statusSorts .btn1" ).click( function()
	{
		$( ".statusSorts .btn1" ).removeClass( "active" );
		$( this ).addClass( "active" );
		var type = $(this).attr("data-sort");
		getMessages(type,1);
	} );

	//清空消息
	$(document).on("click",".statusSorts .emptyBtn",function()
	{
		var type = $(".statusSorts .btn1.active").attr("data-sort");
		$.ajax( {
			type: "POST",
			url: ajaxUrl + "/p-info/deleteSystemMessage",
			data: { "usercode": usercode,"type":type},
			success: function( data )
			{
				console.log( JSON.stringify( data ) );
				if( data.code == 0 )
				{
					layer.msg("已清空");
					//重新加载消息
					getMessages(type,1);
				}
				else
				{
					$.tooltip( data.message );
				}
			},
			error: function( data )
			{
				$.dialog( 'alert', '错误', '服务器走丢了', 1500 );
			}
		} );
	})
	


} );
//获取消息
function getMessages(type,page)
{
	$.ajax( {
		type: "POST",
		url: ajaxUrl + "/p-info/getSystemMessage",
		data: { "usercode": usercode,"type":type, "pageIndex":page},
		success: function( data )
		{
			console.log( JSON.stringify( data ) );
			if( data.code == 0 )
			{
				var count = data.data.count;
				if(type==""){
					$(".allNum").text("（"+count+"）");
				}else if(type==1){
					$(".passedNum").text("（"+count+"）");
					}else{
						$(".repulseNum").text("（"+count+"）");
					}
				var msgs = data.data.data;
				if(msgs.length!=0){
					var result="";
					var passedNum=0,repulseNum=0;
					$.each(msgs,function(i,msg){
						if(type==""){
							if(msg.type==1){//通过
								passedNum++;
							}else{
								repulseNum++;
							}
						}
						var content = msg.content;
						var createTime = msg.createTime.replace(".0","");
						result+='<div class="msgItem"> ' +
										'<div class="content"> ' +
										'<img src="../../img/message.png" alt=""> ' +
										'<span class="text">'+content+'</span> ' +
										'</div> ' +
										'<div class="time">'+createTime+'</div> ' +
										'</div>';
					});
					if(type==""){
						$(".passedNum").text("（"+passedNum+"）");
						$(".repulseNum").text("（"+repulseNum+"）");
					}
					$(".msgArea").html(result);
					//分页
					$(".page-wrap").show();//显示分页
					$( "#page" ).Page( {
						totalPages: data.data.pages,//分页总数
						liNums: 7,//分页的数字按钮数(建议取奇数)
						current: page, //当前页
						activeClass: 'activP', //active 类样式定义
						callBack: function( page )
						{
							$( 'body,html' ).animate( { scrollTop: '0px' }, 500 );
							page++;
							getMessages(type,page);
						}
					} );
				}else{
					$(".page-wrap").hide();//隐藏分页
					var s = '<div class="no-data">' +
									'<img src="../../img/no_data.png" alt="">' +
									'什么都没找到,怪我咯~' +
									'<div>';
					$(".msgArea").html( s );
				}
			
			}
			else
			{
				$.tooltip( data.message );
			}
		},
		error: function( data )
		{
			$.dialog( 'alert', '错误', '服务器走丢了', 1500 );
		}
	} );
}



</script>
</html>